package com.zimmur.dao.order;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zimmur.model.order.OrderDetail;

public interface IOrderDetailDao {

    int deleteByPrimaryKey(Long orderdetailid);
    
    int deleteByOrderId(Long orderId);

    int insertSelective(OrderDetail record);
    /**
     * 批量插入订单明细
     * @param orderDetails
     * @return
     */
    int insertBatch(List<OrderDetail> orderDetails);
    
    OrderDetail selectByPrimaryKey(Long orderdetailid);
    
    List<OrderDetail> selectByOrderId(Long orderId);

    int updateByPrimaryKeySelective(OrderDetail record);
    /**
     * 根据订单号查询其明细 是否以申请售后
     * @param orderId
     * @param goodsTitle 
     * @return
     */
    List<OrderDetail> selectByOrderIdAndIsService(Long orderId);
    /**
     * 修改收货状态
     * @param detail
     * @return
     */
    int updateOrderDetailServiceStatus(OrderDetail detail);

	/**
	* <p>Title: selectByKey</p>
	* <p>Description:查询订单详情返回图片的URL </p>
	* @param orderDetailId
	* @return
	*/
	OrderDetail selectByKey(Long orderDetailId);

	/**
	* <p>Title: selectByOrderIdAndGoodsTitle</p>
	* <p>Description: 根据商品名称和订单查询订单详情</p>
	* @param orderId
	* @param goodsTitle
	* @return
	*/
	List<OrderDetail> selectByOrderIdAndGoodsTitle(@Param("orderId")long orderId,@Param("goodsTitle") String goodsTitle);

	/**
	* <p>Title: selectByDetailIdAndUserId</p>
	* <p>Description: </p>
	* @param detailId
	* @param userId
	* @return
	*/
	OrderDetail selectByDetailIdAndUserId(@Param("detailId")Long detailId, @Param("userId")Long userId);
}